﻿Public Class MAINUSERPRG
    Dim userpolicyF As New USERPOLICY

    Private Sub gotoProgramManage_Click(sender As Object, e As EventArgs)
        For Each f As Form In Application.OpenForms
            If TypeOf f Is SOFTWARELIST Then
                f.Activate()
                f.Refresh()
                f.BringToFront()
                Exit Sub
            Else

            End If
        Next
        'Dim CMSPHERE As New SOFTWARELIST("testja") ไว้ส่งค่าข้ามฟอร์ม
        'Me.PanelEx1.Parent = Nothing
        Dim CMSPHERE As New SOFTWARELIST()
        CMSPHERE.MdiParent = Me.MdiParent
        CMSPHERE.Parent = Me.PanelEx1
        CMSPHERE.Dock = DockStyle.Fill
        CMSPHERE.FormBorderStyle = Windows.Forms.FormBorderStyle.None
        'Me.AdvTree1.Dock = DockStyle.Right
        'Me.AdvTree1.Visible = True
        CMSPHERE.Show()
        CMSPHERE.BringToFront()
    End Sub

    Private Sub gotoUserManage_Click(sender As Object, e As EventArgs)
        For Each f As Form In Application.OpenForms
            If TypeOf f Is USERLIST Then
                f.Activate()
                f.Refresh()
                f.BringToFront()
                Exit Sub
            Else

            End If
        Next
        'Dim CMSPHERE As New SOFTWARELIST("testja") ไว้ส่งค่าข้ามฟอร์ม
        'Me.PanelEx1.Parent = Nothing
        Dim CMSPHERE As New USERLIST()
        CMSPHERE.MdiParent = Me.MdiParent
        CMSPHERE.Parent = Me.PanelEx1
        CMSPHERE.Dock = DockStyle.Fill
        'CMSPHERE.WindowState = FormWindowState.Maximized
        CMSPHERE.FormBorderStyle = Windows.Forms.FormBorderStyle.None
        'Me.AdvTree1.Dock = DockStyle.Right
        'Me.AdvTree1.Visible = True
        CMSPHERE.Show()
        CMSPHERE.BringToFront()
    End Sub

    Private Sub gotoSoftwaresetgroup_Click(sender As Object, e As EventArgs)
        For Each f As Form In Application.OpenForms
            If TypeOf f Is SETGROUP Then
                f.Activate()
                f.Refresh()
                f.BringToFront()
                Exit Sub
            Else

            End If
        Next
        'Dim CMSPHERE As New SOFTWARELIST("testja") ไว้ส่งค่าข้ามฟอร์ม
        'Me.PanelEx1.Parent = Nothing
        Dim CMSPHERE As New SETGROUP()
        CMSPHERE.MdiParent = Me.MdiParent
        CMSPHERE.Parent = Me.PanelEx1
        CMSPHERE.Dock = DockStyle.Fill
        'CMSPHERE.WindowState = FormWindowState.Maximized
        CMSPHERE.FormBorderStyle = Windows.Forms.FormBorderStyle.None
        'Me.AdvTree1.Dock = DockStyle.Right
        'Me.AdvTree1.Visible = True
        CMSPHERE.Show()
        CMSPHERE.BringToFront()
    End Sub

    Private Sub setUserPolicy_NodeClick(sender As Object, e As EventArgs) Handles setUserPolicy.NodeClick
        For Each userpolicyF As Form In Application.OpenForms
            If TypeOf userpolicyF Is USERPOLICY Then
                userpolicyF.Activate()
                userpolicyF.Refresh()
                userpolicyF.BringToFront()
                Exit Sub
            Else

            End If
        Next
        Dim CMSPHERE As New USERPOLICY()
        CMSPHERE.MdiParent = Me.MdiParent
        CMSPHERE.Parent = Me.PanelEx1
        CMSPHERE.Dock = DockStyle.Fill
        CMSPHERE.FormBorderStyle = Windows.Forms.FormBorderStyle.None
        CMSPHERE.Show()
        CMSPHERE.BringToFront()
    End Sub

    Private Sub programInGroup_NodeClick(sender As Object, e As EventArgs) Handles programInGroup.NodeClick
        For Each f As Form In Application.OpenForms
            If TypeOf f Is SOFTWAREINGROUP Then
                f.Activate()
                f.Refresh()
                f.BringToFront()
                Exit Sub
            Else

            End If
        Next
        'Dim CMSPHERE As New SOFTWARELIST("testja") ไว้ส่งค่าข้ามฟอร์ม
        'Me.PanelEx1.Parent = Nothing
        Dim CMSPHERE As New SOFTWAREINGROUP()
        CMSPHERE.MdiParent = Me.MdiParent
        CMSPHERE.Parent = Me.PanelEx1
        CMSPHERE.Dock = DockStyle.Fill
        CMSPHERE.FormBorderStyle = Windows.Forms.FormBorderStyle.None
        'Me.AdvTree1.Dock = DockStyle.Right
        'Me.AdvTree1.Visible = True
        CMSPHERE.Show()
        CMSPHERE.BringToFront()
    End Sub

    Private Sub USERACCOUNT_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub

    Private Sub newGroupProgram_NodeClick(sender As Object, e As EventArgs)
        Dim newFOrm As New NEWGROUPSOFTWARE()
        newFOrm.ShowDialog()
    End Sub

    Private Sub newProgram_NodeClick(sender As Object, e As EventArgs)
        Dim newFOrm As New NEWSOFTWARE()
        newFOrm.ShowDialog()
    End Sub

    Private Sub programList_NodeClick(sender As Object, e As EventArgs) Handles programList.NodeClick
        For Each f As Form In Application.OpenForms
            If TypeOf f Is SOFTWARE Then
                f.Activate()
                f.Refresh()
                f.BringToFront()
                Exit Sub
            Else

            End If
        Next
        'Dim CMSPHERE As New SOFTWARELIST("testja") ไว้ส่งค่าข้ามฟอร์ม
        'Me.PanelEx1.Parent = Nothing
        Dim CMSPHERE As New SOFTWARE()
        CMSPHERE.MdiParent = Me.MdiParent
        CMSPHERE.Parent = Me.PanelEx1
        CMSPHERE.Dock = DockStyle.Fill
        CMSPHERE.FormBorderStyle = Windows.Forms.FormBorderStyle.None
        'Me.AdvTree1.Dock = DockStyle.Right
        'Me.AdvTree1.Visible = True
        CMSPHERE.Show()
        CMSPHERE.BringToFront()
    End Sub

   
End Class